{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>Bootstrap 实例 - 条纹表格</title>
   <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
   <script src="{% static 'js/jquery.min.js' %}"></script>
   <script src="{% static 'js/bootstrap.min.js' %}"></script>
</head>
<body>

<table class="table table-striped">
   <caption>用户列表</caption>
   <thead>
      <tr>
         <th>用户名</th>
         <th>密码</th>
         <th>First Name</th>
         <th>Last Name</th>
      </tr>
   </thead>
   <tbody>
      {% for user in user_list %}
      <tr>
         <td>{{ user.username }}</td>
         <td>{{ user.password }}</td>
         <td>{{ user.first_name }}</td>
         <td>{{ user.last_name }}</td>
      </tr>
      {% endfor %}
   </tbody>
</table>
<form method="post" action="{% url 'test' %}">
{% csrf_token %}
<input type="text" value="" name="key">
<input type="submit" value="提交">
</form>

标签的使用：<br />
if标签：<br />
{% if athlete == '0' %}
    athlete: 0
{% elif athlete == '1' %}
    athlete: 1
{% else %}
    unkown
{% endif %}
<br>
for标签：<br>
<ul>
{% for athlete in athlete_list reversed %}
    <li>{{ forloop.counter0 }} - {{ athlete }}</li>
{% empty %}
    athlete_list没有内容
{% endfor %}
<br>
csrf_token标签：<br>
{% csrf_token %}

{% with total=fdsafsdafdsafdsfadsfafdsa %}
    {{ total }}
{% endwith %}
{% verbatim %}
{{ ver }}
{% endverbatim %}
{% filter force_escape|upper %}
    This text will be HTML-escaped, and will appear in all lowercase.
{% endfilter %}
<br>
{{ value1|upper }}
<br>
{{ value2|add:"2" }}
<br>
{{ value3|date:"Y年m月d日" }}
<br>
{{ value4|default_if_none:"nothing" }}
<br>
{% autoescape off %}
{{ value5|escape }}
{% endautoescape %}
{{ value5|safe}}
{{ value6|filesizeformat }}
{{ value4|first }}
{{ value4|length }}
{{ value7|urlencode }}
{{ value8|truncatewords:5 }}
{{ value5|striptags }}
</ul>
</body>
</html>